jQuery(function($) {
	
});
function onCKeyup_unsign_number(domEle) {
    var state = validateNumber(domEle);
    domEle.value = domEle.value.replace(/\D/g, '');
    return state;
}
function validateNumber(el) {
    var value = el.value;
    value = value.replace(/[\d+]/ig, "");
    if (value.length > 0)
    {
        $(el).focus();
        return false;
    }
    return true;
}
var queryInfo = function(){
	var data = $("#financeInfoQueryForm").serialize();
	var userId = $('#queryDetailForm input[name="userId"]').val();
	if(userId){
		
	}
	$.ajax({
		type:"POST",
		url:ctx + "/admin/finance/userfinanceList",
		data:data,
		cache:false,
		success:function(data){
			$("#user-profile-1").html(data);
			$('[data-rel=tooltip]').tooltip();
		}
	});
}
var loadMyPayData = function(userId,agentId){
	dataUrl = ctx + "/admin/finance/userfinanceList/myPayList";
	$('#queryDetailForm input[name="userId"]').val(userId);
	$('#queryDetailForm input[name="agentId"]').val(agentId);
	$('#queryDetailForm input[name="type"]').val(1);
	var data = $("#queryDetailForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#"+contextId).html(data);
		}
	});
}
var loadMyPlayerData = function(userId,agentId){
	dataUrl = ctx + "/admin/finance/userfinanceList/myPalayerList";
	$('#queryDetailForm input[name="userId"]').val(userId);
	$('#queryDetailForm input[name="agentId"]').val(agentId);
	$('#queryDetailForm input[name="type"]').val(2);
	var data = $("#queryDetailForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#"+contextId).html(data);
		}
	});
}
var loadMyAgentData = function(userId,agentId){
	dataUrl = ctx + "/admin/finance/userfinanceList/myAgentList";
	$('#queryDetailForm input[name="userId"]').val(userId);
	$('#queryDetailForm input[name="agentId"]').val(agentId);
	$('#queryDetailForm input[name="type"]').val(3);
	var data = $("#queryDetailForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#"+contextId).html(data);
		}
	});
}

var showOnePlayerDetail = function(userId){
	dataUrl = ctx + "/admin/finance/userfinanceList/myPayList";
	$('#queryDetailForm input[name="userId"]').val(userId);
	$('#queryDetailForm input[name="type"]').val(1);
	var data = $("#queryDetailForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#"+contextId).html(data);
		}
	});
}
var showOneAgentDetail = function(agentId,userId){
	dataUrl = ctx + "/admin/finance/userfinanceList/myAgentList";
	$('#queryDetailForm input[name="agentId"]').val(agentId);
	$('#queryDetailForm input[name="userId"]').val(userId);
	$('#queryDetailForm input[name="type"]').val(3);
	var data = $("#queryDetailForm").serialize();
	$.ajax({
		type:"POST",
		url:dataUrl,
		data:data,
		cache:false,
		success:function(data){
			$("#"+contextId).html(data);
		}
	});
}
var excel = function(){
	if(!queryDetailForm){
		return;
	}
	var form = $(queryDetailForm);
	form.attr("action", ctx+"/admin/excelExport/userInfoExport");
	form.submit();
}